package com.sunk.spring;

import com.sunk.spring.services.TypeService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.lang.annotation.Annotation;

@SpringBootApplication
public class Application {

	public static void main(String[] args) {
//		SpringApplication.run(Application.class, args);

//		ClassPathXmlApplicationContext cc=new ClassPathXmlApplicationContext("classpath:spring.xml");
//		System.out.println(cc.getBean(TypeService.class).getDemoService());

		AnnotationConfigApplicationContext cc=new AnnotationConfigApplicationContext(Application.class);
		System.out.println(cc.getBean(TypeService.class).getDemoService());
	}

}
